package com.tianzheng.rzzl.base

import android.os.Bundle
import android.view.View
import android.widget.FrameLayout
import androidx.databinding.ViewDataBinding
import com.basic.library.base.BaseFragmentKt
import com.basic.library.base.BaseViewModel
import com.basic.library.utils.LocalData
import com.fileread.Watermark


abstract class AppBaseFragment<V : ViewDataBinding, VM : BaseViewModel> : BaseFragmentKt<V, VM>() {
    val RED = -0x10000
    override fun onNoDoubleClick(v: View) {

    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        water()
    }

    open fun isWater(): View? {
        return null
    }

    fun water() {
        isWater()?.run {
            LocalData.getInstance().userInfo?.let {
                if (this is FrameLayout){
                    Watermark.getInstance().setTextColor(0xFFEAEAEB.toInt())
                    Watermark.getInstance().show(activity, "${it.trueName}\t${it.mobile?.substring((it.mobile?.length!! - 4),it.mobile?.length!!)}", this)
                }
            }
        }
    }
}
